﻿' Copyright © Microsoft Corporation.  All Rights Reserved.
' This code released under the terms of the 
' Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

Imports System
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Windows.Forms
Imports Word = Microsoft.Office.Interop.Word
Imports Office = Microsoft.Office.Core

Public Class SimpleControl

    Private Sub insertButton_Click( _
        ByVal sender As System.Object, _
        ByVal e As System.EventArgs) _
        Handles insertButton.Click

        Try
            If (Not insertTextBox.Text Is String.Empty) Then
                Dim document As Word.Document
                Dim range As Word.Range
                document = Globals.ThisAddIn.Application.ActiveDocument
                range = document.Range()
                range.InsertAfter(insertTextBox.Text)
            End If
        Catch ex As COMException
            System.Diagnostics.Debug.WriteLine(ex.ToString())
        End Try

    End Sub
End Class
